import http from './http'
let root = ''
// console.log("hostname",location.hostname)
if (process.env.NODE_ENV === 'production') {
	// root = '/addons/youmi_activitys/public/'
	root = location.href.indexOf('addons') > -1 ? '/addons/youmi_activitys/public/' : '/index.php'
	console.log("root", root)
} else {
	root = '/public/index.php'
	console.log("root", root)
}

// 合同
//export const pdfUrl = root + '/m/install/contract/'
// 审核员列表获取接口
// export const getAssistUserInfo = (params) => {
//   return http.fetchGet(api.getAssistUserInfo, params)
// }https://www.umiyun.net/addons/youmi_activitys/public/

export default {
	// 推广员插件
	// 根据openid获取推广员信息 ?s=App.Promoter.Itema
	async PromoterItema(params) {
		return await http.fetchPost(root + "?s=App.Promoter.Itema", params)
	},
	// 保存
	async PromoterSave(params) {
		return await http.fetchPost(root + "?s=App.Promoter.Save", params)
	},
	// 获取
	async getConfigItemcommission(params) {
		return await http.fetchPost(root + "?s=App.Config.Itemcommission", params)
	},
	async getActivityItembase64(params) {
		return await http.fetchPost(root + "?s=App.Activity.Itembase64", params)
	},
	async UpdateWriteoff(params) {
		return await http.fetchPost(root + "?s=App.Prize.UpdateWriteoff", params)
	},
	async PrizeDel(params) {
		return await http.fetchPost(root + "?s=App.Prize.Del", params)
	},
	async SaveActPrize(params) {
		return await http.fetchPost(root + "?s=App.Activity.SaveActPrize", params)
	},
	async PrizePage(params) {
		return await http.fetchPost(root + "?s=App.Prize.PagePrize", params)
	},
	async configItemShare(params) {
		return await http.fetchPost(root + "?s=App.Config.ItemShare", params)
	},
	async configJssdk(params) {
		return await http.fetchPost(root + "?s=App.Config.Jssdk", params)
	},
	async BalancePage(params) {
		return await http.fetchPost(root + "?s=App.Balance.Page", params)
	},
	async withdrawalPage(params) {
		return await http.fetchPost(root + "?s=App.Withdrawal.Page", params)
	},
	async withdrawalSave(params) {
		return await http.fetchPost(root + "?s=App.Withdrawal.Save", params)
	},
	async verificationItem(params) {
		return await http.fetchPost(root + "?s=App.Verification.Item", params)
	},
	async getOrderPage(params) {
		return await http.fetchPost(root + "?s=App.Order.Page", params)
	},
	async getMealPage(params) {
		return await http.fetchPost(root + "?s=App.Meal.Page", params)
	},
	async getBillSave(params) {
		return await http.fetchPost(root + "?s=App.Bill.Save", params)
	},
	async getMerchantItems(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Items", params)
	},
	async getVerificationPage(params) {
		return await http.fetchPost(root + "?s=App.Verification.Page", params)
	},
	async getVerificationSave(params) {
		return await http.fetchPost(root + "?s=App.Verification.Save", params)
	},
	async getActivityFans(params) {
		return await http.fetchPost(root + "?s=App.Activity.Count", params)
	},
	async getFansItem(params) {
		return await http.fetchPost(root + "?s=App.Fans.Item", params)
	},
	async getUserInfo(params) {
		return await http.fetchPost(root + "?s=App.Weixin.YongHu", params)
	},
	async getOpenid(params) {
		return await http.fetchPost(root + "?s=App.Weixin.Weixin", params)
	},
	async getWeixinConfig(params) {
		return await http.fetchPost(root + "?s=App.Config.ItemWeixin", params)
	},
	async activityDel(params) {
		return await http.fetchPost(root + "?s=App.Activity.Del", params)
	},
	async activitySave(params) {
		return await http.fetchPost(root + "?s=App.Activity.Save", params)
	},
	async getActivityItem(params) {
		return await http.fetchPost(root + "?s=App.Activity.Item", params)
	},
	async getActivityPage(params) {
		return await http.fetchPost(root + "?s=App.Activity.Page", params)
	},
	async getSlidepicPage(params) {
		return await http.fetchPost(root + "?s=App.Slidepic.Page", params)
	},
	async getArticle(params) {
		return await http.fetchPost(root + "?s=App.Article.Item", params)
	},
	async getMerchantItem(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Item", params)
	},
	async getMerchantPage(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Page", params)
	},
	async saveMerchant(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Save", params)
	},
	async updateCase(params) {
		return await http.fetchPost(root + "?s=App.Cases.Save", params)
	},
	async getCaseById(params) {
		return await http.fetchPost(root + "?s=App.Cases.Item", params)
	},
	async getCaseType(params) {
		return await http.fetchPost(root + "?s=App.Casetype.Page", params)
	},
	async getCaseList(params) {
		return await http.fetchPost(root + "?s=App.Cases.Page", params)
	},
	async getArticleList(params) {
		return await http.fetchPost(root + "?s=App.Article.Page", params)
	},
	async getTabbar(params) {
		return await http.fetchPost(root + "?s=App.Config.Items", params)
	},
	async ConfigItem(params) {
		return await http.fetchPost(root + "?s=App.Config.Item", params)
	},
	uploadPic(params) {
		return http.fetchPostForUpload(root + "?s=App.Examples_Upload.Go", params)
	},
	// 抽奖
	async UpdateWriteoff(params) {
		return await http.fetchPost(root + "?s=App.Prize.UpdateWriteoff", params)
	},
	// 发布活动
	async SaveActConfig(params) {
		return await http.fetchPost(root + "?s=App.Activity.SaveActConfig", params)
	},

	// 拼团查询活动
	async PageActItem(params) {
		return await http.fetchPost(root + "?s=App.Group.PageActItem", params)
	},

	// 核销商品 
	async getUpdateWriteoff(params) {
		return await http.fetchPost(root + "?s=App.Group.UpdateWriteoff", params)
	},

	// 获取虚拟数据 
	async getAvatarPage(params) {
		return await http.fetchPost(root + "?s=App.Avatar.Page", params)
	},

	// 修改虚拟数据 
	async getAvatarSave(params) {
		return await http.fetchPost(root + "?s=App.Avatar.Save", params)
	},

	// 删除虚拟数据 
	async getAvatarDel(params) {
		return await http.fetchPost(root + "?s=App.Avatar.Del", params)
	},

	// 查询用户协议
	async getItemagreement(params) {
		return await http.fetchPost(root + "?s=App.Config.Itemagreement", params)
	},

	// 编辑虚拟人数
	async getAvatarFansinsert(params) {
		return await http.fetchPost(root + "?s=App.Avatar.Fansinsert", params)
	},

	// 获取员工信息
	async getStaffPage(params) {
		return await http.fetchPost(root + "?s=App.Staff.Page", params)
	},

	// 商户授权登录
	async loginM(params) {
		return await http.fetchPost(root + "?s=App.Merlogin.Updates", params)
	},

	// 删除员工信息
	async getStaffDel(params) {
		return await http.fetchPost(root + "?s=App.Staff.Del", params)
	},

	// 查询商家数据
	async getMerchantItemall(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Itemall", params)
	},

	// 查询部门数据
	async getDepartmentPage(params) {
		return await http.fetchPost(root + "?s=App.Department.Page", params)
	},

	// 保存员工信息
	async getStaffSave(params) {
		return await http.fetchPost(root + "?s=App.Staff.Save", params)
	},

	// 查询我的活动
	async getStaffItemall(params) {
		return await http.fetchPost(root + "?s=App.Staff.Itemall", params)
	},

	// 根据商户id查出员工id
	async getStaffItems(params) {
		return await http.fetchPost(root + "?s=App.Staff.Items", params)
	},

	// 查询功能插件类型
	async getModelGN(params) {
		return await http.fetchPost(root + "?s=App.Cases.ModelGN", params)
	},

	// 根据商户id查出员工id （1）
	async getStaffItem(params) {
		return await http.fetchPost(root + "?s=App.Staff.Item", params)
	},

	// 根据商户id查出员工id （今日和累计数据）
	async getStaffItemact(params) {
		return await http.fetchPost(root + "?s=App.Staff.Itemact", params)
	},

	// 查询活动粉丝列表
	async getActivityFansPage(params) {
		return await http.fetchPost(root + "?s=App.ActivityFans.Page", params)
	},

	// 查询音乐列表数据 ?s=App.Music.Page
	async getMusicPage(params) {
		return await http.fetchPost(root + "?s=App.Music.Page", params)
	},

	// 查寻模型
	async getCasesModels(params) {
		return await http.fetchPost(root + "?s=App.Cases.Models", params)
	},

	// 查询订单数折线图 ?s=App.Merchant.Mercountorder
	async getMercountordernum(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Mercountordernum", params)
	},

	// 添加关注信息
	async getFollowSave(params) {
		return await http.fetchPost(root + "?s=App.Follow.Save", params)
	},

	// 查询关注信息
	async getFollowPage(params) {
		return await http.fetchPost(root + "?s=App.Follow.Page", params)
	},
	// 查询拼团信息
	async getGroupmsg(params) {
		return await http.fetchPost(root + "?s=App.Group.Groupmsg", params)
	},
	// 查询投票信息
	async getVotePage(params) {
		return await http.fetchPost(root + "?s=App.Vote.Page", params)
	},
	// 删除投票信息
	async getVoteDel(params) {
		return await http.fetchPost(root + "?s=App.Vote.Del", params)
	},
	// 查询是否时商家
	async getItemopenid(params) {
		return await http.fetchPost(root + "?s=App.Merchant.Itemopenid", params)
	},
	// 判断当前的商户是否需要添加审核的功能
	async getMerchantConfig(params) {
		return await http.fetchPost(root + "?s=App.Config.ItemMerchant", params)
	},

	// 获取vip订单列表
	async getOrderList(params) {
		return await http.fetchPost(root + '?s=App.Bill.Page', params)
	},

	// 获取商户列表数据
	async getMerchantList(params) {
		return await http.fetchPost(root + '?s=App.Merchant.Page', params)
	},
	// 获取推广员列表数据
	async getPromoterList(params) {
		return await http.fetchPost(root + '?s=App.Promoter.Page', params)
	},
	// 获取商品数据
	async getProductPage(params) {
		return await http.fetchPost(root + '?s=App.Product.Page', params)
	},
}